Ext.define('appmod.view.resources.menu.AllTreeGrid', {
    extend: 'Ext.tree.Panel',
	alias: [
		'widget.menu.alltree.grid',
		'widget.menu-alltree-grid',
		'widget.allmenutreegrid'
		], 

    initComponent: function() {
        var me = this;

        Ext.applyIf(me, {
			columns:[{
            	xtype: 'treecolumn', //this is so we know which column will show the tree
            	text: '菜单名称',
            	flex: 2,
            	sortable: true,
            	dataIndex: 'text',
				editor:{
					xtype:'textfield',
					allowBlank: false
				}
        	}, {
				//xtype : 'gridcolumn',
				text :'所属模块',
				width:150,
				dataIndex:'moduleName'
			} , {
				xtype : 'numbercolumn',
				text : '同级排序',
				dataIndex:'sortNum',
				format:'0',
				editor:{
					xtype:'numberfield',
					allowBlank:false,
					minValue : 0,
					maxValue: 100000
				}
			} , {
				xtype : 'booleancolumn',
				text: '访问设定',
				dataIndex : 'disabled',
        		editor: {
            		xtype: 'combobox',
            		typeAhead: true,
            		triggerAction: 'all',
            		selectOnTab: true,
					editable :false,
            		store: Ext.create('Ext.data.ArrayStore', {
						storeId:'selectId',
						fields:['label' , 'value'],
						data:[
							['允许',false],
							['禁止',true]
						]
					}),
					displayField:'label',
					valueField: 'value', 
            		lazyRender: true,
            		listClass: 'x-combo-list-small'
        		},
				renderer:function(value) {
					if (value) {
						return '禁止';
					} else {
						return '允许';
					}						
				}			
			}
			]
					
        });

        me.callParent(arguments);

    }

	
});